/*
 * @Author: your name
 * @Date: 2021-07-28 18:09:27
 * @LastEditTime: 2021-08-22 12:57:28
 * @LastEditors: GGB
 * @Description: In User Settings Edit
 * @FilePath: \flutter_data_center\lib\screens\app\root_app_page.dart
 */
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';
import '../../constants.dart';
import '../../route/routes.dart';
import 'index_screen.dart';

class RootAppScreen extends StatefulWidget {
  const RootAppScreen({Key key}) : super(key: key);

  @override
  _RootAppScreenState createState() => _RootAppScreenState();
}

class _RootAppScreenState extends State<RootAppScreen> {
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      theme: ThemeData(
        primaryColor: primaryColor,
        textTheme: TextTheme(
          bodyText1: GoogleFonts.roboto(),
          bodyText2: GoogleFonts.roboto(),
        ),
        scaffoldBackgroundColor: Colors.white,
      ),
      // locale: Get.deviceLocale,
      // locale: Locale('en', 'US'),
      // fallbackLocale: Locale('en', 'UK'),
      localizationsDelegates: [
        GlobalWidgetsLocalizations.delegate,
        GlobalMaterialLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
      ],
      supportedLocales: [
        // Locale('en', 'UK'),
        const Locale.fromSubtags(languageCode: 'zh'), // generic Chinese 'zh'
        const Locale.fromSubtags(
            languageCode: 'zh',
            scriptCode: 'Hans'), // generic simplified Chinese 'zh_Hans'
        const Locale.fromSubtags(
            languageCode: 'zh',
            scriptCode: 'Hant'), // generic traditional Chinese 'zh_Hant'
        const Locale.fromSubtags(
            languageCode: 'zh',
            scriptCode: 'Hans',
            countryCode: 'CN'), // 'zh_Hans_CN'
        const Locale.fromSubtags(
            languageCode: 'zh',
            scriptCode: 'Hant',
            countryCode: 'TW'), // 'zh_Hant_TW'
        const Locale.fromSubtags(
            languageCode: 'zh', scriptCode: 'Hant', countryCode: 'HK'),
      ],
      debugShowCheckedModeBanner: false,
      initialRoute: IndexScreen.routeName,
      routes: routes,
    );
  }
}
